Thread: a program recursive print from 1 to 2^n

  1. #16
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    What compiler are you using...

    If it's not going past 16 bits I'm guessing you're using some old DOS version of Turbo C... which has been obsolete for more than a decade.

    Grab a newer compiler... Pelles C is a good choice. When you download it spend some time in the help file and learn what's going on before you do any coding... In particular look up the tutorial on making your first project.

  2. #17
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    ... or use a long type.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  3. #18
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    FYI: It is normally not allowed to use a loop in a recursive function by the teachers doing the grading.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  4. #19
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    @OP: Also learn about bitwise shifts (<< and >>), because they'll help you in this situation.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with a recursive expression tree program
    By TeamRival in forum C Programming
    Replies: 6
    Last Post: 03-25-2011, 07:27 PM
  2. Tracing through a recursive program in C
    By Hybodus in forum C Programming
    Replies: 3
    Last Post: 12-18-2010, 05:48 PM
  3. Recursive print every time...
    By BobDole11 in forum C Programming
    Replies: 5
    Last Post: 10-27-2008, 12:42 AM
  4. Recursive binary search program help.
    By mooney in forum C Programming
    Replies: 3
    Last Post: 04-04-2008, 01:12 AM
  5. Help!!this program is Recursive Function or not?
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 06-25-2002, 03:40 AM